package net.jbaez.code;

import java.util.List;

/*
 * Copyright 2008 DynamiCode 
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); 
 * you may not use this file except in compliance with the License. 
 * You may obtain a copy of the License at 
 *
 * http://www.apache.org/licenses/LICENSE-2.0 
 *
 * Unless required by applicable law or agreed to in writing, 
 * software distributed under the License is distributed on an 
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 
 * either express or implied. See the License for the specific 
 * language governing permissions and limitations under the License. 
 */
/**
 * Represnetacion de una clase Java
 */
public class JClass extends JAnnotatedElement implements ITypeElement<JClass> {

    // El tipo de la clase
    private IType<JClass> type = new JClassType(this);
    //Arreglo con los constructores de la
    //Clase
    private List<JConstructor> constructors;

    @Override
    public IType<JClass> getType() {
	return type;
    }

    public JConstructor createConstructor(JParam<?> ... params){
	return null;
    }
    
    /**
     * Clase que representa a el tipo de las instancias de JClass
     */
    private static class JClassType implements IType<JClass> {
	// Referencia a la clase
	private JClass clazz;

	JClassType(JClass clazz) {
	    this.clazz = clazz;
	}

	public boolean equlas(Object obj) {
	    if (obj instanceof JClassType) {
		JClassType ct = (JClassType) obj;
		return ct.clazz == clazz;
	    } else {
		return false;
	    }
	}
    }
}
